import Mock from 'mockjs'
import { getResult } from './utils.js'
// 柱状图
Mock.mock(/\/aaa/, 'get', (res) => {
  const data = {
    "tx_status": "00",
    "data": {
      "xAxisList": ["北京166", "天津244", "湖北355"],
      "yAxisList": ["男", "女"],
      "data": [[11, 22, 33], [44, 33, 22]]
    },
  }
  return getResult(data)
})

// 饼图
Mock.mock(/\/bbb/, 'get', (res) => {
  const data = {
    "tx_status": "00",
    "data": [
      {
        "value": 1111,
        "name": "佛教"
      },
      {
        "value": 2222,
        "name": "道教"
      },
      {
        "value": 580,
        "name": "伊斯兰教"
      },
      {
        "value": 484,
        "name": "天主教"
      },
      {
        "value": 300,
        "name": "基督教"
      }
    ]
  }
  return getResult(data)
})

// 文字
Mock.mock(/\/ccc/, 'get', (res) => {
  const data = {
    "tx_status": "00",
    "text": '我是请求回来的额文字'
  }
  return getResult(data)
})

// 表格
Mock.mock(/\/ddd/, 'get', (res) => {
  const data = {
    "tx_status": "00",
    "data": [
      {date: '2016-05-02', name: '王小虎1', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎2', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎3', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路'},
      {date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路'},
    ]
  }
  return getResult(data)
})

// 列表
Mock.mock(/\/eee/, 'get', (res) => {
  const data = {
    "tx_status": "00",
    "data": [
      {
        "title": "动态标题",
        "local": "小标题",
        "pople": "发布人",
        "time": "2021-01-03 15:04:34"
      },
      {
        "title": "标题",
        "local": "小标题",
        "pople": "发布人",
        "time": "2021-01-03 15:04:34"
      }
    ]
  }
  return getResult(data)
})
